package control.panel
{
	import events.PlayEvent;
	
	import view.panel.play.CardRecordPanel;

	public class CardRecordPanelControl extends PanelControl
	{
		public function CardRecordPanelControl()
		{
			initPanel();
			initLisenter();
		}
		
		private function initLisenter():void
		{
			_model.playerModel.addEventListener(PlayEvent.SHOW_RECORD_CARDS,onShowRecordCards);
		}
		
		private function onShowRecordCards(event:PlayEvent):void
		{
			_view.cardRecordPanel.clear();
			_view.cardRecordPanel.update(event.cardDatas);
			open();
		}
		
		private function initPanel():void
		{
			_view.cardRecordPanel = new CardRecordPanel(this);
			
		}
		
		public function open():void
		{
			
			_view.cardRecordPanel.open();
		}
	}
}